home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_qt.idb / usr / freeware / catman / p_man / cat3 / qdialog.Z / qdialog
Encoding:
Text File  |  1998-10-28  |  16.1 KB  |  331 lines

  1.  
  2.  
  3.  
  4.      QQQQDDDDiiiiaaaalllloooogggg((((3333qqqqtttt))))    TTTTrrrroooollllllll TTTTeeeecccchhhh AAAASSSS ((((9999 JJJJuuuullllyyyy 1111999999998888))))      QQQQDDDDiiiiaaaalllloooogggg((((3333qqqqtttt))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.       QDialog - The    base class of dialog windows
  10.  
  11.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.       #include <qdialog.h>
  13.  
  14.       Inherits QWidget.
  15.  
  16.       Inherited by QFileDialog, QMessageBox, QPrintDialog and
  17.       QTabDialog.
  18.  
  19.     PPPPuuuubbbblllliiiicccc MMMMeeeemmmmbbbbeeeerrrrssss
  20.       QQQQDDDDiiiiaaaalllloooogggg (((( QQQQWWWWiiiiddddggggeeeetttt **** _p_a_r_e_n_t====0000,,,,    ccccoooonnnnsssstttt cccchhhhaaaarrrr **** _n_a_m_e====0000,,,, bbbboooooooollll
  21.           _m_o_d_a_l
  22.       ~~~~QQQQDDDDiiiiaaaalllloooogggg ()
  23.       iiiinnnntttt eeeexxxxeeeecccc (((())))
  24.       iiiinnnntttt rrrreeeessssuuuulllltttt (((())))    ccccoooonnnnsssstttt
  25.       vvvviiiirrrrttttuuuuaaaallll vvvvooooiiiidddd sssshhhhoooowwww (((())))
  26.       vvvviiiirrrrttttuuuuaaaallll vvvvooooiiiidddd mmmmoooovvvveeee (((( iiiinnnntttt _x,,,, iiiinnnntttt yyyy ))))
  27.       vvvvooooiiiidddd mmmmoooovvvveeee (((( ccccoooonnnnsssstttt QQQQPPPPooooiiiinnnntttt &&&& pppp ))))
  28.       vvvviiiirrrrttttuuuuaaaallll vvvvooooiiiidddd rrrreeeessssiiiizzzzeeee ((((    iiiinnnntttt _w,,,, iiiinnnntttt hhhh ))))
  29.       vvvvooooiiiidddd rrrreeeessssiiiizzzzeeee ((((    ccccoooonnnnsssstttt QQQQSSSSiiiizzzzeeee &&&& ))))
  30.       vvvviiiirrrrttttuuuuaaaallll vvvvooooiiiidddd sssseeeettttGGGGeeeeoooommmmeeeettttrrrryyyy (((( iiiinnnntttt _x,,,, iiiinnnntttt    _y,,,, iiiinnnntttt _w
  31.       vvvvooooiiiidddd sssseeeettttGGGGeeeeoooommmmeeeettttrrrryyyy (((( ccccoooonnnnsssstttt QQQQRRRReeeecccctttt &&&& ))))
  32.  
  33.     PPPPrrrrooootttteeeecccctttteeeedddd MMMMeeeemmmmbbbbeeeerrrrssss
  34.       vvvvooooiiiidddd sssseeeettttRRRReeeessssuuuulllltttt (((( iiiinnnntttt rrrr ))))
  35.       vvvviiiirrrrttttuuuuaaaallll vvvvooooiiiidddd kkkkeeeeyyyyPPPPrrrreeeessssssssEEEEvvvveeeennnntttt (((( QQQQKKKKeeeeyyyyEEEEvvvveeeennnntttt **** ))))
  36.       vvvviiiirrrrttttuuuuaaaallll vvvvooooiiiidddd cccclllloooosssseeeeEEEEvvvveeeennnntttt (((( QQQQCCCClllloooosssseeeeEEEEvvvveeeennnntttt    **** ))))
  37.  
  38.     PPPPrrrrooootttteeeecccctttteeeedddd SSSSlllloooottttssss
  39.       vvvviiiirrrrttttuuuuaaaallll vvvvooooiiiidddd ddddoooonnnneeee (((( iiiinnnntttt ))))
  40.       vvvvooooiiiidddd aaaacccccccceeeepppptttt (((())))
  41.       vvvvooooiiiidddd rrrreeeejjjjeeeecccctttt (((())))
  42.  
  43.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  44.       The QDialog class is the base    class of dialog    windows.
  45.  
  46.       A dialog window is a widget used to communicate with the
  47.       user.    It offers mechanisms such as default buttons.
  48.  
  49.       The dialog window can    either be modeless or modal. A
  50.       modeless dialog is a normal window, while a modal window
  51.       must be finished before the user can continue    with other
  52.       parts    of the program.    The third constructor argument must be
  53.       set to TRUE to create    a modal    dialog,    otherwise it will
  54.       create a modeless dialog.
  55.  
  56.       Example (your    own modal dialog):
  57.  
  58.           class Modal : public QDialog {
  59.           Q_OBJECT
  60.  
  61.  
  62.  
  63.      Page 1                         (printed 9/22/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      QQQQDDDDiiiiaaaalllloooogggg((((3333qqqqtttt))))    TTTTrrrroooollllllll TTTTeeeecccchhhh AAAASSSS ((((9999 JJJJuuuullllyyyy 1111999999998888))))      QQQQDDDDiiiiaaaalllloooogggg((((3333qqqqtttt))))
  71.  
  72.  
  73.  
  74.           public:
  75.           Modal( QWidget *parent, const    char *name );
  76.           };
  77.           Modal::Modal( QWidget *parent, const char    *name )
  78.           : QDialog( parent, name, TRUE    )
  79.           {
  80.           QPushButton *ok, *cancel;
  81.           ok = new QPushButton(    "Ok", this );
  82.           ok->setGeometry( 10,10, 100,30 );
  83.           connect( ok, SIGNAL(clicked()), SLOT(accept()) );
  84.           cancel = new QPushButton( "Cancel", this );
  85.           cancel->setGeometry( 10,60, 100,30 );
  86.           connect( cancel, SIGNAL(clicked()), SLOT(reject()) );
  87.           }
  88.  
  89.       Note that the    parent widget has a different meaning for
  90.       modal    dialogs    than for other types of    widgets. A dialog is
  91.       placed on top    of the parent widget. The dialog is centered
  92.       on the screen    if the parent widget is    zero.
  93.  
  94.       You would normally call exec() to start a modal dialog. This
  95.       enters a local event loop, which is terminated when the
  96.       modal    dialog calls done() (or    accept() or reject()).
  97.  
  98.       Example (using a modal dialog):
  99.  
  100.           Modal m;
  101.           if ( m.exec() ) {
  102.          // ok was pressed, then fetch the interesting dialog data
  103.           }
  104.  
  105.       Modeless dialogs behave just like ordinary widgets. The only
  106.       difference is    that they have the default button mechanism.
  107.  
  108.       See also: QTabDialog,    QWidget, QSemiModal and    GUI Design
  109.       Handbook: Dialogs, Standard.
  110.  
  111.       Examples:  xform/xform.cpp
  112.  
  113.      MMMMEEEEMMMMBBBBEEEERRRR FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN DDDDOOOOCCCCUUUUMMMMEEEENNNNTTTTAAAATTTTIIIIOOOONNNN
  114.      QQQQDDDDiiiiaaaalllloooogggg::::::::QQQQDDDDiiiiaaaalllloooogggg ((((    QQQQWWWWiiiiddddggggeeeetttt    **** ppppaaaarrrreeeennnntttt====0000,,,, ccccoooonnnnsssstttt cccchhhhaaaarrrr **** nnnnaaaammmmeeee====0000,,,, bbbboooooooollll
  115.       mmmmooooddddaaaallll====FFFFAAAALLLLSSSSEEEE,,,, WWWWFFFFllllaaaaggggssss ffff====0000 ))))
  116.       Constructs a dialog named _n_a_m_e, which    has a parent widget
  117.       _p_a_r_e_n_t.
  118.  
  119.       The dialog will by default be    modeless, unless you set _m_o_d_a_l
  120.       to TRUE to contruct a    modal dialog.
  121.  
  122.       The _f    argument is the    widget flags, which can    be used    to
  123.       customize the    window frame style.
  124.  
  125.       WWWWaaaarrrrnnnniiiinnnngggg:::: Creating a modeless dialog with a parent makes it
  126.  
  127.  
  128.  
  129.      Page 2                         (printed 9/22/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      QQQQDDDDiiiiaaaalllloooogggg((((3333qqqqtttt))))    TTTTrrrroooollllllll TTTTeeeecccchhhh AAAASSSS ((((9999 JJJJuuuullllyyyy 1111999999998888))))      QQQQDDDDiiiiaaaalllloooogggg((((3333qqqqtttt))))
  137.  
  138.  
  139.  
  140.       an ordinary child widget, which is probably not what you
  141.       want.    Expect strange behavior    (QDialog has a default button
  142.       mechanism).
  143.  
  144.      QQQQDDDDiiiiaaaalllloooogggg::::::::~~~~QQQQDDDDiiiiaaaalllloooogggg (((())))
  145.       Destroys the QDialog and all its children.
  146.  
  147.      vvvvooooiiiidddd QQQQDDDDiiiiaaaalllloooogggg::::::::aaaacccccccceeeepppptttt (((()))) [[[[pppprrrrooootttteeeecccctttteeeedddd    ssssllllooootttt]]]]
  148.       Closes the dialog and    sets the result    code to    Accepted.
  149.  
  150.       Equivalent to    done(Accepted);.
  151.  
  152.      vvvvooooiiiidddd QQQQDDDDiiiiaaaalllloooogggg::::::::cccclllloooosssseeeeEEEEvvvveeeennnntttt ((((    QQQQCCCClllloooosssseeeeEEEEvvvveeeennnntttt **** eeee    )))) [[[[vvvviiiirrrrttttuuuuaaaallll pppprrrrooootttteeeecccctttteeeedddd]]]]
  153.       Calls    reject() if it is a modal dialog, or accepts the close
  154.       event    if it is a modeless dialog.
  155.  
  156.       Reimplemented    from QWidget.
  157.  
  158.      vvvvooooiiiidddd QQQQDDDDiiiiaaaalllloooogggg::::::::ddddoooonnnneeee    (((( iiiinnnntttt rrrr    )))) [[[[vvvviiiirrrrttttuuuuaaaallll pppprrrrooootttteeeecccctttteeeedddd ssssllllooootttt]]]]
  159.       Closes the dialog and    sets the result    code to    _r.
  160.  
  161.       Equivalent to    calling    hide(),    then setResult(_r ).
  162.  
  163.       This function    is very    useful for modal dialogs. It leaves
  164.       the local event loop and returns from    the exec() or show()
  165.       function.
  166.  
  167.       WWWWaaaarrrrnnnniiiinnnngggg:::: Although done() will    return to the caller if    this
  168.       dialog is modal, the local event loop    is then    marked for
  169.       termination. Hence, a    program    should not try to do anything
  170.       that depends on event    handling before    the corresponding
  171.       exec() or show() has returned.
  172.  
  173.       See also: accept() and reject().
  174.  
  175.      iiiinnnntttt QQQQDDDDiiiiaaaalllloooogggg::::::::eeeexxxxeeeecccc (((())))
  176.       Starts the dialog and    returns    the result code.
  177.  
  178.       Equivalent to    calling    show(),    then result().
  179.  
  180.       This function    is very    useful for modal dialogs. It enters a
  181.       new local event loop.    The event loop is terminated when the
  182.       dialog is hidden, usually by calling done().
  183.  
  184.      vvvvooooiiiidddd QQQQDDDDiiiiaaaalllloooogggg::::::::kkkkeeeeyyyyPPPPrrrreeeessssssssEEEEvvvveeeennnntttt (((( QQQQKKKKeeeeyyyyEEEEvvvveeeennnntttt **** eeee )))) [[[[vvvviiiirrrrttttuuuuaaaallll pppprrrrooootttteeeecccctttteeeedddd]]]]
  185.       Handles key press events for the dialog.
  186.  
  187.       Calls    reject() if Escape is pressed. Simulates a button
  188.       click    for the    default    button if Enter    is pressed. All    other
  189.       keys are ignored.
  190.  
  191.       Reimplemented    from QWidget.
  192.  
  193.  
  194.  
  195.      Page 3                         (printed 9/22/98)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      QQQQDDDDiiiiaaaalllloooogggg((((3333qqqqtttt))))    TTTTrrrroooollllllll TTTTeeeecccchhhh AAAASSSS ((((9999 JJJJuuuullllyyyy 1111999999998888))))      QQQQDDDDiiiiaaaalllloooogggg((((3333qqqqtttt))))
  203.  
  204.  
  205.  
  206.      vvvvooooiiiidddd QQQQDDDDiiiiaaaalllloooogggg::::::::mmmmoooovvvveeee    (((( ccccoooonnnnsssstttt    QQQQPPPPooooiiiinnnntttt &&&& pppp ))))
  207.       Reimplements QWidget::move() for internal purposes.
  208.  
  209.      vvvvooooiiiidddd QQQQDDDDiiiiaaaalllloooogggg::::::::mmmmoooovvvveeee    (((( iiiinnnntttt xxxx,,,, iiiinnnntttt yyyy )))) [[[[vvvviiiirrrrttttuuuuaaaallll]]]]
  210.       Reimplements QWidget::move() for internal purposes.
  211.  
  212.       Reimplemented    from QWidget.
  213.  
  214.      vvvvooooiiiidddd QQQQDDDDiiiiaaaalllloooogggg::::::::rrrreeeejjjjeeeecccctttt (((()))) [[[[pppprrrrooootttteeeecccctttteeeedddd    ssssllllooootttt]]]]
  215.       Closes the dialog and    sets the result    code to    Rejected.
  216.  
  217.       Equivalent to    done(Rejected);.
  218.  
  219.      vvvvooooiiiidddd QQQQDDDDiiiiaaaalllloooogggg::::::::rrrreeeessssiiiizzzzeeee (((( ccccoooonnnnsssstttt QQQQSSSSiiiizzzzeeee    &&&& ssss ))))
  220.       Reimplements QWidget::resize() for internal purposes.
  221.  
  222.       Examples:  pref/pref.cpp
  223.  
  224.      vvvvooooiiiidddd QQQQDDDDiiiiaaaalllloooogggg::::::::rrrreeeessssiiiizzzzeeee (((( iiiinnnntttt    wwww,,,, iiiinnnntttt hhhh )))) [[[[vvvviiiirrrrttttuuuuaaaallll]]]]
  225.       Reimplements QWidget::resize() for internal purposes.
  226.  
  227.       Reimplemented    from QWidget.
  228.  
  229.      iiiinnnntttt QQQQDDDDiiiiaaaalllloooogggg::::::::rrrreeeessssuuuulllltttt (((()))) ccccoooonnnnsssstttt
  230.       Returns the result code of the dialog.
  231.  
  232.      vvvvooooiiiidddd QQQQDDDDiiiiaaaalllloooogggg::::::::sssseeeettttGGGGeeeeoooommmmeeeettttrrrryyyy (((( ccccoooonnnnsssstttt QQQQRRRReeeecccctttt &&&& rrrr ))))
  233.       Reimplements QWidget::setGeometry() for internal purposes.
  234.  
  235.      vvvvooooiiiidddd QQQQDDDDiiiiaaaalllloooogggg::::::::sssseeeettttGGGGeeeeoooommmmeeeettttrrrryyyy (((( iiiinnnntttt xxxx,,,,    iiiinnnntttt yyyy,,,, iiiinnnntttt wwww,,,, iiiinnnntttt hhhh ))))
  236.       [[[[vvvviiiirrrrttttuuuuaaaallll]]]]
  237.       Reimplements QWidget::setGeometry() for internal purposes.
  238.  
  239.       Examples:  xform/xform.cpp
  240.  
  241.       Reimplemented    from QWidget.
  242.  
  243.      vvvvooooiiiidddd QQQQDDDDiiiiaaaalllloooogggg::::::::sssseeeettttRRRReeeessssuuuulllltttt (((( iiiinnnntttt )))) [[[[pppprrrrooootttteeeecccctttteeeedddd]]]]
  244.       Sets the result code of the dialog.
  245.  
  246.      vvvvooooiiiidddd QQQQDDDDiiiiaaaalllloooogggg::::::::sssshhhhoooowwww    (((()))) [[[[vvvviiiirrrrttttuuuuaaaallll]]]]
  247.       Shows    the dialog box on the screen, as QWidget::show() and
  248.       enters a local event loop if this dialog is modal (see
  249.       constructor).
  250.  
  251.       This implementation also does    automatic resizing and
  252.       automatic positioning. If you    have not already resized or
  253.       moved    the dialog, it will find a size    that fits the contents
  254.       and a    position near the middle of the    screen (or centered
  255.       relative to the parent widget    if any).
  256.  
  257.       WWWWaaaarrrrnnnniiiinnnngggg:::: Calling show() for a    modal dialog enters a local
  258.  
  259.  
  260.  
  261.      Page 4                         (printed 9/22/98)
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.      QQQQDDDDiiiiaaaalllloooogggg((((3333qqqqtttt))))    TTTTrrrroooollllllll TTTTeeeecccchhhh AAAASSSS ((((9999 JJJJuuuullllyyyy 1111999999998888))))      QQQQDDDDiiiiaaaalllloooogggg((((3333qqqqtttt))))
  269.  
  270.  
  271.  
  272.       event    loop. The event    loop is    terminated when    the dialog is
  273.       hidden, usually by calling done().
  274.  
  275.       See also: exec().
  276.  
  277.       Examples:  movies/main.cpp xform/xform.cpp
  278.  
  279.       Reimplemented    from QWidget.
  280.  
  281.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  282.       hhhhttttttttpppp::::////////wwwwwwwwwwww....ttttrrrroooollllllll....nnnnoooo////qqqqtttt////qqqqddddiiiiaaaalllloooogggg....hhhhttttmmmmllll
  283.  
  284.      CCCCOOOOPPPPYYYYRRRRIIIIGGGGHHHHTTTT
  285.       Copyright 1992-1997 Troll Tech AS.  See the LICENSE file
  286.       included in the distribution for a complete license
  287.       statement.
  288.  
  289.      AAAAUUUUTTTTHHHHOOOORRRR
  290.       Generated automatically from the source code.
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.      Page 5                         (printed 9/22/98)
  328.  
  329.  
  330.  
  331.